* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    color: white;
    overflow-x: hidden;
}

.starry-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a2a6c, #b21f1f, #fdbb2d);
    z-index: -1;
}

.starry-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 90px 40px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #ffffff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 4s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 18px;
}

.music-player {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.3);
}

.play-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.play-button:hover {
    background-color: white;
    transform: scale(1.1);
}

.play-button.playing {
    background-color: #ff4757;
    color: white;
}

.progress-bar {
    width: 150px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: #ffffff;
}

.nav-links {
    display: flex;
    gap: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.card {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
}

.chat-card {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    background: linear-gradient(135deg, rgba(106, 90, 205, 0.3), rgba(72, 61, 139, 0.3));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 500px; /* 从 400px 改为 200px */
}

.profile-card {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    background: linear-gradient(135deg, rgba(70, 130, 180, 0.3), rgba(25, 25, 112, 0.3));
}

/* .encounter-card {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(75, 0, 130, 0.3));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
} */

.encounter-card {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(75, 0, 130, 0.3));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 500px; /* 确保高度一致 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card.encounter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.clickable-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.profile-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.profile-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.profile-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 5px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    display: block;
    text-align: center;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.edit-bio {
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.edit-bio:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 20px 30px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 200px;
    transition: transform 0.3s ease;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-icon {
    font-size: 24px;
}

.btn-pink {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
}

.btn-yellow {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: black;
}

.btn-blue {
    background: linear-gradient(135deg, #1e90ff, #0000cd);
    color: white;
}

.btn-subtext {
    font-size: 12px;
    opacity: 0.8;
}

@media (max-width: 1024px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
    }
    .card-container {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* 共用发送按钮样式 */
.common-submit-area {
    text-align: center;
    margin: 20px auto;
}

.main-send-btn {
    background: linear-gradient(135deg, #ff6b8b, #ff4757);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 139, 0.3);
}

.main-send-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 139, 0.4);
}

.main-send-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 视频播放区域样式 */
.video-player-container {
    margin: 20px auto;
    text-align: center;
    display: none;
}

.video-player-container.active {
    display: block;
}

.video-player {
    width: 100%;
    max-width: 800px;
    height: 450px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.chat-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(17, 24, 39, 0.7);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.5);
}

.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 平行宇宙消息 - 左对齐 */
.parallel-message {
    justify-content: flex-start;
}

/* 用户消息 - 右对齐 */
.user-message {
    justify-content: flex-end;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .message-avatar {
    order: 2;
    margin-right: 0;
    margin-left: 12px;
}

.avatar-stars {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.message-content {
    display: flex;
    flex-direction: column;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.parallel-message .message-bubble {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-top-left-radius: 4px;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: white;
    border-top-right-radius: 4px;
}

.system-message .message-bubble {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    text-align: center;
    margin: 10px auto;
    border-radius: 12px;
}

.message-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.parallel-message .message-meta {
    align-self: flex-start;
}

.user-message .message-meta {
    align-self: flex-end;
}

.chat-input-area {
    position: relative;
}

.dual-forms-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.message-form {
    flex: 1; /* 平均分配空间 */
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    height: 350px; /* 固定表单高度 */
    display: flex; /* 使用flex布局 */
    flex-direction: column; /* 垂直排列 */
}

.message-form h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.message-form h3.feelings-heading {
    height: 120px; /* 统一固定高度 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; /* 防止内容溢出 */
    line-height: 1.5; /* 统一行高 */
    padding: 10px; /* 添加内边距确保内容居中 */
    margin-bottom: 15px; /* 统一下边距 */
}

.message-input {
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: white;
    resize: none;
    box-sizing: border-box;
}

.message-input:focus {
    outline: none;
    border-color: #8ab4f8;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    color: #ccc;
}


.btn-send {
    background: linear-gradient(135deg, #8ab4f8, #4285f4);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-send:active {
    transform: translateY(0);
}


.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #4a90e2;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

/* 加载指示器样式 */
.message.loading .message-content {
  padding: 12px 16px;
}

.typing-indicator {
  display: flex;
  padding: 10px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #8b5cf6;
  border-radius: 50%;
  margin: 0 3px;
  animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 添加播放按钮的加载状态样式 */
.play-button.loading {
    animation: spin 1s linear infinite;
    cursor: wait;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.play-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}